package com.apartment.dao;

import com.apartment.data.view.Collectview;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

/**
 * Author : xuzhiyong
 * Date : 2022/6/5 23:36
 */
public interface CollectviewDao extends JpaRepository<Collectview,Integer>{

    @Query(value = "select c.id,c.address,c.apartment_statu,c.apartment_type,c.content,c.picture,c.price,c.username,c.user_id,c.apartment_id,c.landlord_id from Collectview c where c.user_id=?1",nativeQuery = true)
    List<Collectview> findCollectByUserId(Integer id);
}
